package com.mrtan.config;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

@Component
public class LocalDateConvert implements Converter<String, LocalDate> {
    @Override
    public LocalDate convert(String source) {
        return DateTimeFormatter.ofPattern("yyyy-MM-dd").parse(source,LocalDate::from);
    }
}
